package com.he.fetch.test.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name = "ROLE")
public class Role implements java.io.Serializable {

    private static final long serialVersionUID = 1658539316700444916L;

    @Column(name = "DESCRIPTION", length = 255)
    private String description;

    @Id
    @Column(name = "NAME", nullable = false, unique = true, updatable = false, length = 31)
    private String name;

    @Override
    public boolean equals(Object obj) {
	if (obj != null && obj instanceof Role) {
	    return hashCode() == obj.hashCode();
	}
	return false;
    }

    public String getDescription() {
	return this.description;
    }

    public String getName() {
	return this.name;
    }

    @Override
    public int hashCode() {
	return this.name == null ? 0 : this.name.hashCode();
    }

    public void setDescription(String description) {
	this.description = description;
    }

    public void setName(String name) {
	this.name = name;
    }

    @Override
    public String toString() {
	return this.name;
    }

}
